<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <link href="../css/test.css" rel="stylesheet">
    <title>Items</title>
</head>
<body>
<header th:replace="common/top.html"></header>
<section class="content">
    <main>
        <div class="container">
            <div class="title">Items</div>
            <form action="/item/getItemSpecial" method="post">
                <section class="section">
                    <form action="/product/getSpecialProduct" method="post">
                        <div class="field">
                            <label for="categoryName" class="label">Item Search</label>
                        </div>
                        <div class="field has-addons">
                            <div class="control is-expanded">
                                <input class="input" type="text" id="categoryName" name="categoryName"
                                       placeholder="Find an item">
                            </div>
                            <div class="control">
                                <a class="button is-primary">
                                    Search
                                </a>
                            </div>
                        </div>
                        <!--    <input name="categoryName" type="text" th:text="${categoryName}" th:value="${categoryName}" disabled>-->
                        <!--                <div class="form-group">-->
                        <!--                    <label for="productName" class="col-sm-2 control-label">productName:</label>-->
                        <!--                    <div class="col-sm-10">-->
                        <!--                        <input type="text" name="productName" class="form-control" id="productName"-->
                        <!--                               placeholder="input the name of product to search">-->
                        <!--                    </div>-->

                        <!--                    <div class="form-group">-->
                        <!--                        <div class="col-sm-offset-2 col-sm-10">-->
                        <!--                            <button type="submit" class="btn btn-default">search</button>-->
                        <!--                        </div>-->
                        <!--                    </div>-->
                        <!--                </div>-->
                    </form>
                </section>
                <!--                <div class="form-group">-->
                <!--                    <label for="itemId" class="col-sm-2 control-label">itemId:</label>-->
                <!--                    <div class="col-sm-10">-->
                <!--                        <input type="text" name="itemId" class="form-control" id="itemId"-->
                <!--                               placeholder="input the id of item to search">-->
                <!--                    </div>-->

                <!--                    <div class="form-group">-->
                <!--                        <div class="col-sm-offset-2 col-sm-10">-->
                <!--                            <button type="submit" class="btn btn-default">search</button>-->
                <!--                        </div>-->
                <!--                    </div>-->
                <!--                </div>-->
            </form>

            <table id="item" class="table table-bordered table-striped table-hover">
                <tr>
                    <th>Item Id</th>
                </tr>
                <tr th:each="item:${session?.itemList}">
                    <td>
                        <a th:href="@{/item/getItemInfo(itemId=${item.itemId})}" th:text="${item.itemId}"></a>
                    </td>
                    <td><a th:href="@{/item/deleteItem(itemId=${item.itemId},delete=${3})}">delete</a></td>
                </tr>
            </table>

            <a href="/item/toaddItem">新增item</a></br>

        </div>
    </main>
</section>
<header th:replace="common/bottom.html"></header>

</body>
</html>